////////////////////////////////////////////////////////////////////////////
//
// Copyright 2018 Realm Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
////////////////////////////////////////////////////////////////////////////

@import "~realm-studio-styles/variables";

.Log {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  user-select: none;

  .ReactVirtualized {
    &__List {
      &:focus {
        outline: none;
      }
    }
  }

  &__Table {
    flex-grow: 1;
  }

  &__Entry {
    align-items: flex-start;
    border-bottom: 1px solid $dove;
    display: flex;
    padding: .1rem 0;

    $danger-text: darken($danger, 20%);
    $danger-background: rgba($danger, .1);

    &--fatal,
    &--error {
      background: $danger-background;

      .Log__Entry__Level,
      .Log__Entry__Message {
        color: $danger-text;
      }
    }

    &--warn {
      .Log__Entry__Level,
      .Log__Entry__Message {
        color: $warning;
      }
    }

    &--debug,
    &--detail,
    &--trace {
      .Log__Entry__Level,
      .Log__Entry__Message {
        color: $elephant;
      }
    }

    &__Rows {
      flex-grow: 1;
    }

    &__Row {
      align-items: flex-start;
      display: flex;
    }

    &__Level,
    &__Message {
      font-size: .7rem;
    }

    &__Level {
      flex-shrink: 0;
      text-align: center;
      width: 1.2 * $spacer;
    }

    &__Message {
      flex-grow: 1;
      font-family: $font-family-monospace;
      user-select: text;
    }

    &__Badges {
      flex: none;
      font-size: .8rem;
      margin-right: .25rem;
    }

    &__Badge {
      margin-left: $spacer / 4;
    }

    &__Context {
      user-select: text;
    }
  }

  &__Controls {
    align-items: center;
    background: $window-background;
    display: flex;
    font-size: .875rem;
    justify-content: space-between;
    padding: $spacer / 2;
  }

  &__LevelSelector {
    &__Icon {
      float: right;
    }
  }
}
